// -----------------------------------------------------------------------------
// r1p group For 5N
// -----------------------------------------------------------------------------
$.fn.getR1data = function(_lotto_id,_gametype){
  $().disAreaObj();
  var showType = $("div#rdiShowType input:radio:checked").val();
  $.getJSON('op.php?op=xml_3d&fp=rate_3d&playtype=r1p&lotto_id_3d='+_lotto_id+"&gametype="+_gametype+"&disk="+ $("select#slcDisk").val() + "&showType=" + showType ,function(ratedata){
      var dataLen = 0;
      var urlPre = "";
      var hrefStr = "";
      var palygroup = "r1p";
      
      if(ratedata.errormsg != undefined){
        $("div#errormsg").addClass("error").text("No Rate data");
      }else{
        var disk = $("select#slcDisk").val(); 
        var showType = $("div#rdiShowType input:radio:checked").val();
        switch(showType){
          case '5':
            $().showTableData(ratedata.r69_0,"r69",disk,_gametype,palygroup,'69');
            $().showTabelDataTwoFace(ratedata.r56_0,"tblNowBet02",disk,_gametype,palygroup,'56');
            $().showTabelDataTwoFace(ratedata.r57_0,"tblNowBet02",disk,_gametype,palygroup,'57');
            $().showTabelDataTwoFace(ratedata.r58_0,"tblNowBet02",disk,_gametype,palygroup,'58');
            break;
            
          case '4':
            $().showTableData(ratedata.r70_0,"r70",disk,_gametype,palygroup,'70');
            $().showTabelDataTwoFace(ratedata.r59_0,"tblNowBet02",disk,_gametype,palygroup,'59');
            $().showTabelDataTwoFace(ratedata.r60_0,"tblNowBet02",disk,_gametype,palygroup,'60');
            $().showTabelDataTwoFace(ratedata.r61_0,"tblNowBet02",disk,_gametype,palygroup,'61');
           break;
           
          case '3':
            $().showTableData(ratedata.r1_0,"r1",disk,_gametype,palygroup,'1');
            $().showTabelDataTwoFace(ratedata.r4_0,"tblNowBet02",disk,_gametype,palygroup,'4');
            $().showTabelDataTwoFace(ratedata.r7_0,"tblNowBet02",disk,_gametype,palygroup,'7');
            $().showTabelDataTwoFace(ratedata.r10_0,"tblNowBet02",disk,_gametype,palygroup,'10');
            break;
           
          case '2':
            $().showTableData(ratedata.r2_0,"r2",disk,_gametype,palygroup,'2');
            $().showTabelDataTwoFace(ratedata.r5_0,"tblNowBet02",disk,_gametype,palygroup,'5');
            $().showTabelDataTwoFace(ratedata.r8_0,"tblNowBet02",disk,_gametype,palygroup,'8');
            $().showTabelDataTwoFace(ratedata.r11_0,"tblNowBet02",disk,_gametype,palygroup,'11');
            break;
           
          case '1': 
            $().showTableData(ratedata.r3_0,"r3",disk,_gametype,palygroup,'3');
            $().showTabelDataTwoFace(ratedata.r6_0,"tblNowBet02",disk,_gametype,palygroup,'6');
            $().showTabelDataTwoFace(ratedata.r9_0,"tblNowBet02",disk,_gametype,palygroup,'9');
            $().showTabelDataTwoFace(ratedata.r12_0,"tblNowBet02",disk,_gametype,palygroup,'12');
            break;
          
          case '0':
          default:
            $().showTableData(ratedata.r55_0,"r55",disk,_gametype,palygroup,'55');
            $().showTableData(ratedata.r0_2,"r0V2",disk,_gametype,palygroup,'0_2');
            $().showTableData(ratedata.r0_1,"r0V1",disk,_gametype,palygroup,'0_1');
            $().showTableData(ratedata.r0_0,"r0V0",disk,_gametype,palygroup,'0_0');
            break;
        }        
   }
   
   $().redisAreaObj();
   $("div#mainPageData").show();
   $("div#errormsg").text("");
   // change text or checkbox type
    var timebtnType = $("input:hidden#timebtnType").val();
    if(timebtnType == "checkbox"){
      $().timebtnTypeToCheckbox(); 
    }
  });
};